<?php
/**
 * @Name  : DepartmentSaveRequest.php
 * @Author: yashuai
 */

namespace App\Http\Requests\Org;

use App\Http\Requests\PackingRequest;

class DepartmentSaveRequest extends PackingRequest
{

    public function rules()
    {
        return [
            'Name'      => 'required|between:1,20',
            'ParentID'  => 'integer',
            'Order'     => 'integer',
            'MasterID'  => 'integer',
            'PeopleNum' => 'integer',
        ];
    }

    public function messages()
    {
        return [
            'Name.required'     => '请输入部门名称',
            'Name.between'      => '部门名称长度过长',
            'ParentID.integer'  => '上级部门ID类型异常',
            'Order.integer'     => '排序类型异常',
            'MasterID.integer'  => '部门主管类型异常',
            'PeopleNum.integer' => '部门人数类型异常',
        ];
    }
}
